<?php
	include("../../include/dbconnect.php");
	extract($_POST);
	$strdk=" where ma='$ma'";
	if($ma=="") $strdk="";
	$table="groups";
	session_start();
	header("Content-Type: text/xml");
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
	echo "<$table>";
	if($_SESSION["un"]=="")
	{
		echo "<status>fail</status>";
		echo "<count>0</count>";
		echo "<message>Chưa đăng nhập !</message>";
	}
	else 
	{
		$result=mysql_query("select * from $table $strdk",$conn);
		echo "<status>ok</status>";
		echo "<count>",mysql_num_rows($result),"</count>";
		echo "<message>OK</message>";	
		while($a=mysql_fetch_array($result))
		{
			echo "<row id='",$a["ma"],"'>";
			echo "<cell>",$a["ma"],"</cell>";
			echo "<cell><![CDATA[",$a["ten"],"]]></cell>";
			echo "</row>";
		}
		mysql_free_result($result);
	}

	echo "</$table>";
	include("../../include/dbclose.php");
?>